﻿using Sustainalytics.ESG.Entities;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using FluentAssertions;
using MongoDB.Driver;
using Sustainalytics.DataLayer.Shared;
using MongoDB.Bson;
using MongoDB.Driver.Linq;
using MongoDB.Driver.Core;

namespace Sustainalytics.Entities.Tests.CompareTimestamped
{
    [Trait("Category", "Unit")]
    public class Timestamped_CompareTo_Should
    {
        [Fact]
        public void return_ordered_collection_when_type_is_string()
        {
            var timestampedList = new List<Timestamped<string>>() { "Banco Regional S.A.E.C.A",
                "A. H. Belo Corporation",
                "A. O. Smith Corporation",
                "58.com Inc.",
                "VaaaaaAmalia",
                "Bavaria",
                "-1",
                "1",
                "12",
                "Chevron Corporation",
                "A Brown Company"
            };

            timestampedList.OrderBy(x => x).Should().BeInAscendingOrder();

        }

        [Fact]
        public void return_ordered_collection_when_type_is_int()
        {
            var timestampedList = new List<Timestamped<int>>() { 1, 14, 7, 9, -2,-7, -3, 67, 230, -150, 175, -26, 25 };

            timestampedList.OrderBy(x => x).Should().BeInAscendingOrder();
         
        }

        [Fact]
        public void return_ordered_collection_when_type_is_float()
        {
            var timestampedList = new List<Timestamped<float>>() { 1.34f, -3.12f, 1.53f, -10.23f, 7.678f, 7.676f, 7.679f };

            timestampedList.OrderBy(x => x).Should().BeInAscendingOrder();


        }

    }
}
